-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude expired transactions when counting block size during block creation #13850
Conversation
consensus/src/quorum_store/utils.rs
Outdated
// latest_block_timestamp is microseonds since UNIX epoch | ||
// expiration_timestamp_secs is seconds since UNIX epoch | ||
// giving a second buffer for expiration as the expiration time is rounded off to seconds | ||
&& ((txn_summary.expiration_timestamp_secs + 1) * MICRO_SEC_PER_SEC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be careful here.
- The multiplication as-is could overflow. So we should instead do integer division.
- We should match the move spec for expiration.
The move spec appears to be
aptos-core/aptos-move/framework/aptos-framework/sources/transaction_validation.move
Lines 83 to 86 in 533f3c3
assert!( | |
timestamp::now_seconds() < txn_expiration_time, | |
error::invalid_argument(PROLOGUE_ETRANSACTION_EXPIRED), | |
); |
where now_seconds() is the current block timestamp truncated to seconds.
So it appears the correct condition is:
(self.latest_block_timestamp + 1) / MICRO_SEC_PER_SEC < txn_summary.expiration_timestamp_secs
because the current block timestamp must be monotonically increasing from the previous timestamp.
If we want a truly accurate expiration condition, we can pass in the current block's timestamp from proposal_generator. I'm not sure that's necessary, as the number of truly unexpired transactions <= unique txn size based on the txn summaries we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are intending to approximate self.latest_block_timestamp/MICRO_SEC_PER_SEC
with the next integer value, did you mean (self.latest_block_timestamp + MICRO_SEC_PER_SEC) / MICRO_SEC_PER_SEC < txn_summary.expiration_timestamp_secs
?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
…eation (#13850) * Use proof queue asynchronously * Committing what I have * Sending AddBatches message * Calcuating the remaining txns * Calculate proof queue size correctly * Add a counter * Update pfn_const_tps test * Minor changes * Minor change * Add some coutners * Rust lint * Increasing quorum store backpressure limits * setting dynamic_min_txns_per_sec to 160 * Fixing the calculation * increase vfns to 7 * Fixing the typo in batch generator * Add increase fraction * Removing skipped transactions after inserting them * Add some counters * Update consensus pending duration counter * Add more counters * Increasing block size to 2500 * Update a counter * Increase block size limit * Resetting execution config params * Moving proof queue to utils.rs * Moving counters * Use transaction summary * intelligent pull proofs * Fix a bug in pull proofs * Fix the bug * Rest to full to false in every iteration * Addressing PR comments * Move backpressure_tx to proof queue * Add info statement * Change buckets * Add some info statements * Cleanup * Remove an unrelated change * Addressing PR comments * Addressing PR comments * Add some timer counters * Add more timer counters * Minor optimization * Proof queue to be part of proof manager * Move some code to a function * Minor fixes * Add max_unique_txns parameter * Use Lazy * Removing comments * Minor change * Minor change * Minor fix * Add unit test and address PR comments * Minor fix in proof manager * Use saturating_sub * Exclude expired transactions when counting block size * Minor fix * Addressing PR comments * Minor fix * Change the expiration units * Fixing unit tests * Update unit tests * renaming * Add block_timestamp as inputt to pull_proofs * Fix test
Description
Exclude expired transactions when counting block size during block creation
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Key Areas to Review
Checklist